<template>
  <!-- 营销素材消息列表项 -->
  <div class="list-item" @click="handleClickItem">
    <!--文章  -->
    <div class="content" v-if="info.type == 1">
      <img :src="info.marketingCover" alt="" srcset="" />
      <div class="info">
        <div class="title text-one-ellipsis">{{ info.title }}</div>
        <div class="desc text-one-ellipsis">{{ info.marketingDescribe }}</div>
      </div>
    </div>
    <!-- 链接 -->
    <div class="content" v-else-if="info.type == 2">
      <img :src="info.marketingCover" alt="" srcset="" />
      <div class="info">
        <div class="title text-one-ellipsis">{{ info.title }}</div>
        <div class="desc text-one-ellipsis">{{ info.marketingDescribe }}</div>
      </div>
    </div>
    <!-- 海报 -->
    <div class="content" v-else-if="info.type == 3">
      <img :src="info.marketingUrl" alt="" srcset="" />
      <div class="info">
        <div class="title text-one-ellipsis">{{ info.title }}</div>
        <div class="desc text-one-ellipsis">{{ info.marketingSize }}</div>
      </div>
    </div>
    <!-- 文件 -->
    <div class="content" v-else>
      <img v-if="info.type == 4" src="@/assets/pdf.png" alt="" srcset="" />
      <img v-else-if="info.type == 5" src="@/assets/ppt.png" alt="" srcset="" />
      <img v-else-if="info.type == 6" src="@/assets/excel.png" alt="" srcset="" />
      <img v-else-if="info.type == 7" src="@/assets/word.png" alt="" srcset="" />
      <div class="info">
        <div class="title text-one-ellipsis">{{ info.title }}</div>
        <div class="desc text-one-ellipsis">{{ info.marketingSize }}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    info: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  components: {},
  data() {
    return {}
  },
  created() {},
  mounted() {},
  watch: {},
  methods: {
    handleClickItem() {
      this.$emit('handleClickItem', this.info)
    }
  }
}
</script>
<style lang="less" scoped>
.list-item {
  width: 100%;
  padding: 16px;
  background: #fafafa;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  .content {
    display: flex;
  }
  img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }
  video {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }
  .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 8px;
    width: 175px;
    .title {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #2c2c2c;
    }
    .desc {
      font-size: 12px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(44, 44, 44, 0.5);
    }
  }
}
</style>